#ifndef UNIT_H_INCLUDED
#define UNIT_H_INCLUDED

#include "Object.h"
#include <cstdlib>
#include <string>

class Unit: public Object
{
    public:
        Unit();
        Unit(Artist& artist, std::string Type = "missing");
        Unit(int Hp, int Weight = 0, int Speed = 5);
        Unit(SDL_Rect Bounds, int Hp = 0, int Weight = 0, int Speed = 5);

        ~Unit();

        Unit(Unit&);

        void set_hp(int);
        void set_maxHp(int);
        void set_weight(int);
        void set_speed(int);
        void set_image(Artist& artist, std::string filepath = "");
        void set_bounds(SDL_Rect box);
        void clone(Unit&);
        Unit operator=(Unit&);

        int getXVelocity();
        int getYVelocity();

        int get_xAcc();
        int get_yAcc();

        int get_hp();
        int get_maxHp();
        int get_weight();
        int get_speed();
        int get_image();
        int get_walljump();

        SDL_Rect* get_bounds();

        void display(SDL_Rect camera, SDL_Surface* screen);

        void take_damage(int);

        void rotateSprite(Artist& artist, Direction dir);

        void incXVelocity(int amount);
        void incYVelocity(int amount);
        void setXVelocity(int amount);
        void setYVelocity(int amount);
        void setXAcc(int amount);
        void setYAcc(int amount);
        void inc_x(int amount);
        void inc_y(int amount);
        void teleport(SDL_Rect box);
        void teleport(int x, int y);
        void move(Direction dir, int amount);
        SDL_Rect get_move(Direction dir, int amount);
        void walk(Direction gravity_dir, Direction dir);
        void stand();
        void jump(Direction dir);
        SDL_Rect fall(Direction gravity, int gravity);

    protected:
        int hp, maxHp, weight, speed, jump_dist, walljump;
        int xAcc, yAcc;
        bool facing_left;

        virtual void initFromFile();
};

#endif // UNIT_H_INCLUDED
